package fr.afcepf.atod21.brigade.dto;

import java.util.ArrayList;
import java.util.List;

import fr.afcepf.atod21.brigade.entity.Intervention;

public class DtoConverter {
	
	public static InterventionDto InterventionToInterventionDto(Intervention intervention){
		InterventionDto intervDto = new InterventionDto(intervention.getIdIntervention(),
				intervention.getCommentaire(),
				intervention.getNumero(),
				intervention.getTraite(),
				intervention.getAdresse(),
				intervention.getPrenom(),
				intervention.getNom(),
				intervention.getDateDebut(), 
				intervention.getDateFin(),
				intervention.getIdReve());
		return intervDto;
	}
	
	public static List<InterventionDto> InterventionsToInterventionsDto(List<Intervention> listeInterventions){
		List<InterventionDto> listeInterventionsDto = new ArrayList<InterventionDto>();
		for (Intervention intervention : listeInterventions) {
			listeInterventionsDto.add(InterventionToInterventionDto(intervention));
		}
		return listeInterventionsDto;
	}
}
